package com.lv.controller;

import com.lv.data.Result;
import com.lv.service.GoodsService;
import com.lv.vo.GoodsVO;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("go")
public class GoodsController {

    @DubboReference
    private GoodsService gs;

    @RequestMapping("/toship")
    public String toShip() {
        return "admin/goods";
    }

    @RequestMapping("getUp")
    @ResponseBody
    public Result getUp(){
        List<GoodsVO> vo = gs.getUp();
        return Result.OK().setData(vo);
    }
    @RequestMapping("up")
    @ResponseBody
    public Result up(String auditStatus ,String[] ids){
        Integer i = gs.up(auditStatus,ids);
        return Result.OK();
    }
    @RequestMapping("del")
    @ResponseBody
    public Result up(Long[] ids){
        Integer i = gs.del(ids);
        return Result.OK();
    }
}
